<?php
	
	session_start();
	if(!isset($_SESSION['friends']))
		die("Data not available");
	
	$user_friends = $_SESSION['friends'];
	$user_name = $_SESSION['name'];
	
	
	// div that shows the friends who are selected
	echo '<div style="position:relative">';
	echo '<div id="gp_frnd_list_sel" style=";max-height:400px;overflow:auto;width:540px;border:1px solid #ccc; border-radius:3px;padding:5px"> 
	<input type="text" name="frnd_search"  onkeyup="filter_frndlst(this.value)" placeholder="start typing" style="border:none" filter="width:100%"/>
	</div>';
	//echo '</td></tr></table>';
	echo '<span style="display:none" id="gp_frnd_list_sel_id"></span>';
	
	
	//echo 
	//'<div>
	//<input type="text" name="frnd_search"  onkeyup="filter_frndlst(this.value)" placeholder="add friends" filter="width:100%"/>
	//</div>';
	
	
	
	//	div that displays the friend list
	echo '<div id="gp_frnd_list" style=";max-height:200px;overflow:auto;display:none;width:550px;position:absolute;border:1px solid #aaa;background:#fff" class="shadow1">';
	$frns_len = sizeof($user_friends['data']);
	for($i=0;$i<$frns_len;$i++)
	{
		echo '<div class="gp_frnd_list_wrapper"><input type="checkbox" class="frndlst" name="frndlst" id="frndlst_'.$user_friends["data"][$i]["id"].'" style="display:none" onchange="frndlst_click()"/>		
		<label for="frndlst_'.$user_friends["data"][$i]["id"].'" >		
		<div class="frndlst_item">		
		<span id="frndlst_'.$user_friends["data"][$i]["id"].'_name" class="frndlst_name">'.$user_friends["data"][$i]["name"].'</span>		
		</div></label></div>';
	}	
	echo '</div>';
	
	echo '</div><br>';
	
	
	
	//echo '<div><span id="gp_frnd_list_count">'.sizeof($user_friends["data"]).'</span> friends </div><br>';	
	
	//echo '<table style="width:100%;height:400px"><tr><td style="width:50%">';	
	
	//echo '</td><td>';
	
	
	
	
?>